package com.dhcc.DRGsHosp.facade.impl.assembler;

import java.util.ArrayList;
import java.util.Collection;
import java.util.List;

import com.dhcc.DRGsHosp.core.domain.MiMonthProPortion;
import com.dhcc.DRGsHosp.facade.dto.MiMonthProPortionDTO;

public class MiMonthProPortionAssembler {
	
	public static MiMonthProPortionDTO  toDTO(MiMonthProPortion  miMonthProPortion){
		if (miMonthProPortion == null) {
			return null;
		}
    	MiMonthProPortionDTO result  = new MiMonthProPortionDTO();
	    	result.setMimpMonth (miMonthProPortion.getMimpMonth());
     	    	result.setMimpValue (miMonthProPortion.getMimpValue());
     	    return result;
	 }
	
	public static List<MiMonthProPortionDTO>  toDTOs(Collection<MiMonthProPortion>  miMonthProPortions){
		if (miMonthProPortions == null) {
			return null;
		}
		List<MiMonthProPortionDTO> results = new ArrayList<MiMonthProPortionDTO>();
		for (MiMonthProPortion each : miMonthProPortions) {
			results.add(toDTO(each));
		}
		return results;
	}
	
	 public static MiMonthProPortion  toEntity(MiMonthProPortionDTO  miMonthProPortionDTO){
	 	if (miMonthProPortionDTO == null) {
			return null;
		}
	 	MiMonthProPortion result  = new MiMonthProPortion();
        result.setMimpMonth (miMonthProPortionDTO.getMimpMonth());
         result.setMimpValue (miMonthProPortionDTO.getMimpValue());
 	  	return result;
	 }
	
	public static List<MiMonthProPortion> toEntities(Collection<MiMonthProPortionDTO> miMonthProPortionDTOs) {
		if (miMonthProPortionDTOs == null) {
			return null;
		}
		
		List<MiMonthProPortion> results = new ArrayList<MiMonthProPortion>();
		for (MiMonthProPortionDTO each : miMonthProPortionDTOs) {
			results.add(toEntity(each));
		}
		return results;
	}
}
